Create A Dictionary
(29 actions, 19 KB)
0 If
[Shortcut Input]
has any value
1 Get Dictionary from
[Shortcut Input]
ă»
4
6
10
2 Ask for Text Inpută»
AskActionPrompt
:
Key?
AllowsMultilineText
:
false
3 Set Variable
Key
to
[2 Provided Input]
4 If
[1 Dictionary
âs Keys
]
contains
[Key]
5 Show Alert
â This key "
[Key]
" already exists.
AlertActionCancelButtonShown
:
false
6 Run Shortcut
Adding To A Dictionary
Input
:
[1 Dictionary]
Workflow
:
{ "workflowName": "Adding To A Dictionary", "isSelf": false }
ShowWorkflow
:
false
7 Otherwise
8 Ask for Text Inpută»
AskActionPrompt
:
Value?
AllowsMultilineText
:
false
9 Set Variable
Value
to
[8 Provided Input]
10 Set Dictionary Value for
[Key]
to
[Value]
in
[1 Dictionary]
11 End If
12 Otherwiseăâ”
0
13 Dictionaryă»
18
14 Ask for Text Inpută»
AskActionPrompt
:
Key?
AllowsMultilineText
:
false
15 Set Variable
Key
to
[14 Ask for Input]
16 Ask for Text Inpută»
AskActionPrompt
:
Value?
AllowsMultilineText
:
false
17 Set Variable
Value
to
[16 Ask for Input]
18 Set Dictionary Value for
[Key]
to
[Value]
in
[13 Dictionary]
19 End Ifăâ”
12
ă»
21
25
27
20 DataJar > GetValueIntentă»
22
keyPath
:
Text Divider
21 Run Shortcut
Pretty Print Dictionary
ă»
Input
:
[19 If Result]
Workflow
:
{ "workflowIdentifier": "0F135E84-71A6-46BF-BC50-10FC69B847A2", "workflowName": "Pretty Print Dictionary", "isSelf": false }
22 Textă»
[20 Value]
[21 Shortcut Result]
[20 Value]
â đ€ Add more keys?
23 Choose from Menu
MenuPrompt
:
[22 Text]
MenuItems
:
[â Yes, â No]
24 Menu Item
â Yes
25 Run Shortcut
Adding To A Dictionary - json 1
Input
:
[19 If Result]
Workflow
:
{ "workflowIdentifier": "ACC3C32C-C2FC-4A88-B420-7DC4ADC52C72", "workflowName": "Adding To A Dictionary - json 1", "isSelf": true }
26 Menu Item
â No
27 Stop and Output
[19 If Result]
28 End Menu